<%--
  Created by IntelliJ IDEA.
  User: WY2015092804
  Date: 2015/10/22
  Time: 16:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="st" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="easyui" uri="http://www.joyi.cn/easyui/tags" %>
<%@ taglib prefix="joyi" uri="http://www.joyi.cn/tags" %>
<%@ taglib prefix="j" uri="j/tags" %>
<st:page title="职位管理">
  <div data-options="region:'center',title:'职位管理'">
    <joyi:dataGrid id="positionList" toolbarId="addPosition" key="getPositionList" ></joyi:dataGrid>
    <div id="addPosition" >
      <easyui:linkButton name="添加职位" iconKey="add" onClick="editPosition();"></easyui:linkButton>
    </div>
  </div>
  <script>
    //编辑职位
    function editPosition(id){
      j.open("/user/req?rid=<j:des data="20151023000000000001"/>&positionId="+id,"editPosition",{title:"编辑职位"},500,400);
    }

    function delPosition(id){
      $.messager.confirm('确认','您确认想要删除记录吗?',function(r){
        if (r){
          Http.post("/user/req?rid=<j:des data="20151023000000000003"/>&positionId="+id,{},function(data){
            $.messager.alert('消息',data.data);
            reloadPositionList();
          });
        }
      });
    }
    function reloadPositionList(){
      $("#positionList").datagrid("reload");
    }
  </script>
</st:page>
